from django.db import models
from .__baseModel import BaseModel
from .categoryModel import Category

class Content(BaseModel):
    name = models.CharField(max_length=20, null=False)
    category = models.ForeignKey(Category, on_delete=models.CASCADE)
    video = models.FileField(upload_to='static/upload/video', db_comment='视频')
    video_height = models.IntegerField(default=0)
    video_width = models.IntegerField(default=0)
    img = models.FileField(upload_to='static/upload/img', blank=True, db_comment='图片')
    audio = models.FileField(upload_to='static/upload/audio', blank=True, db_comment='音频')
    vip = models.BooleanField(default=False, db_comment='是否需要VIP')
    show = models.BooleanField(default=True, db_comment='是否显示')
    read_count = models.IntegerField(default=0, db_comment='阅读数量')

    # def __str__(self):
    #     return self.name